﻿using System;
using System.IO;
using Ionic.Utils.Zip;

namespace Bookvar.Common
{
	public static class ZipHelper
	{
		public static void ExtractZip(string zipFileName, string destinationFolder)
		{
			if (!String.IsNullOrEmpty(zipFileName))
			{
				using (ZipFile file = ZipFile.Read(zipFileName))
				{
					file.ExtractAll(destinationFolder);
				}
			}
		}
//
//		public static void CopyFolder(string source, string dest)
//		{
//			if (!Directory.Exists(dest))
//			{
//				Directory.CreateDirectory(dest);
//			}
//			foreach (string sourceFileName in Directory.GetFiles(source))
//			{
//				string destFileName = Path.Combine(dest, Path.GetFileName(sourceFileName));
//				File.Copy(sourceFileName, destFileName);
//			}
//			foreach (string sourceDir in Directory.GetDirectories(source))
//			{
//				DirectoryInfo directoryInfo = new DirectoryInfo(sourceDir);
//				string dest2 = Path.Combine(dest, directoryInfo.Name);
//				CopyFolder(sourceDir, dest2);
//			}
//		}
	}
}